<!--
 * @Author: xiaotiwen
 * @Date: 2020-06-17 10:19:49
 * @LastEditTime: 2020-07-23 14:53:45
 * @LastEditors: xiaotiwen
 * @FilePath: \eduweb\src\views\practiceManagement\baseList\index.vue
 * @Description: 实习基地管理
-->

<template>
    <!-- 实习基地列表 -->
    <div class="edu-page-warp">
        <InnerBreadcrumb v-model="indexKey" :path="breadPath"></InnerBreadcrumb>
        <div v-if="indexKey === '0'">
            <condition-card @search="onSubmit" @reset="reset" label-width="120px">
                <el-row>
                    <el-col :span="8">
                        <el-form-item
                            :label="$t('practiceManagement.label.baseName')"
                        >
                            <el-input v-model="condition.baseName" :placeholder="$t('fundingManagement.tips.plzInput')" maxlength="50"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item :label="$t('practiceManagement.label.toSign')">
                            <el-select
                                v-model="condition.signConFlag"
                                :placeholder="$t('message.plzSelect')"
                                size="small"
                            >
                                <el-option
                                    :label="$t('practiceManagement.yes')"
                                    value="Y"
                                ></el-option>
                                <el-option
                                    :label="$t('practiceManagement.no')"
                                    value="N"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item :label="$t('courseSummary.aduitType')">
                            <el-select
                                v-model="condition.status"
                                :placeholder="$t('message.plzSelect')"
                            >
                                <el-option
                                    value="DRAFT"
                                    :label="$t('practiceManagement.status.draft')"
                                ></el-option>
                                <el-option
                                    value="INPROCESS"
                                    :label="$t('practiceManagement.status.inProcess')"
                                ></el-option>
                                <el-option
                                    value="APPROVED"
                                    :label="$t('practiceManagement.status.approved')"
                                ></el-option>
                                <el-option
                                    value="REJECTED"
                                    :label="$t('practiceManagement.status.rejected')"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="8">
                        <el-form-item :label="$t('practiceManagement.label.effectStatus')">
                            <el-select
                                v-model="condition.effectStatus"
                                :placeholder="$t('message.plzSelect')"
                                size="small"
                            >
                                <el-option
                                    :label="$t('practiceManagement.yes')"
                                    value="Y"
                                ></el-option>
                                <el-option
                                    :label="$t('practiceManagement.no')"
                                    value="N"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item :label="$t('label.college')">
                            <DictSelect
                                :labelAll="$t('message.plzSelect')"
                                v-model="condition.academyId"
                                :data="options.faculty"
                                @change="changeFaculty"
                            ></DictSelect>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item
                            :label="$t('practiceManagement.label.brilliantBaseFlag')"
                            label-width="160px"
                        >
                            <el-select
                                v-model="condition.brilliantBaseFlag"
                                :placeholder="$t('message.plzSelect')"
                                size="small"
                            >
                                <el-option
                                    :label="$t('practiceManagement.yes')"
                                    value="Y"
                                ></el-option>
                                <el-option
                                    :label="$t('practiceManagement.no')"
                                    value="N"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item :label="$t('practiceManagement.label.validDateStart')">
                            <el-date-picker
                                v-model="condition.validDateStart"
                                type="date"
                                clearable
                                value-format="yyyy-MM-dd"
                                format="yyyy-MM-dd"
                                :placeholder="$t('practiceManagement.tips.selectStartTime')"
                                style="width: 180px"
                                :picker-options="pickerOptions"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item :label="$t('practiceManagement.label.validDateEnd')">
                            <el-date-picker
                                v-model="condition.validDateEnd"
                                type="date"
                                clearable
                                value-format="yyyy-MM-dd"
                                format="yyyy-MM-dd"
                                :placeholder="$t('practiceManagement.tips.selectEndTime')"
                                style="width: 180px"
                                :picker-options="pickerOptions2"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
            </condition-card>

            <el-card shadow="never" body-style="padding: 24px;">
                <div class="edu-page-title tip">{{ $t('practiceManagement.title.baseTitle') }}</div>
                <div class="edu-opertion-bar">
                    <div class="float-right">
                        <el-button type="primary" @click="exportRecord">
                            {{ $t('message.export') }}
                        </el-button>
                        <el-button @click="approval" v-if="menuAuths.aduitBatch" type="primary">
                            {{ $t('message.AllApproval') }}
                        </el-button>
                        <el-button @click="add()" type="primary">{{ $t('message.add') }}</el-button>
                    </div>
                </div>
                <el-table
                    :data="tableData"
                    style="width: 100%"
                    stripe
                    @selection-change="selectionChange"
                    @select-all="selectAll"
                    tooltip-effect="light"
                    ref="multipleTable"
                >
                    <el-table-column fixed="left" type="selection" width="30"></el-table-column>
                    <el-table-column width="50" align="center" type="index" :index="indexMethod" :label="$t('message.order')" fixed="left" ></el-table-column>
                    <el-table-column
                        fixed="left"
                        :label="$t('practiceManagement.label.baseName')"
                        prop="baseName"
                        show-overflow-tooltip
                        min-width="150"
                    ></el-table-column>
                    <el-table-column
                        :label="$t('practiceManagement.label.address')"
                        prop="address"
                        min-width="150"
                        show-overflow-tooltip
                    ></el-table-column>
                    <el-table-column
                        :label="$t('label.college')"
                        prop="academyName"
                        min-width="150"
                        show-overflow-tooltip
                    ></el-table-column>
                    <el-table-column
                        :label="$t('practiceManagement.label.maxNum')"
                        prop="acceptNum"
                        min-width="120"
                        show-overflow-tooltip
                        align="center"
                    ></el-table-column>
                    <el-table-column
                        :label="$t('practiceManagement.label.validDateStart')"
                        prop="validDateStart"
                        show-overflow-tooltip
                        min-width="100"
                    ></el-table-column>
                    <el-table-column
                        :label="$t('practiceManagement.label.validDateEnd')"
                        prop="validDateEnd"
                        show-overflow-tooltip
                        min-width="100"
                    ></el-table-column>
                    <el-table-column
                        :label="$t('practiceManagement.label.toSign')"
                        show-overflow-tooltip
                        min-width="80"
                        align="center"
                    >
                        <template slot-scope="scope">
                            <el-tag v-if="scope.row.signConFlag == 'Y'" type="success">
                                {{ $t('practiceManagement.yes') }}
                            </el-tag>
                            <el-tag v-if="scope.row.signConFlag == 'N'" type="warning">
                                {{ $t('practiceManagement.no') }}
                            </el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column
                        :label="$t('practiceManagement.label.signConDate')"
                        prop="signConDate"
                        show-overflow-tooltip
                        min-width="100"
                    ></el-table-column>
                    <el-table-column
                        :label="$t('practiceManagement.label.brilliantBaseFlag')"
                        show-overflow-tooltip
                        min-width="160"
                        align="center"
                    >
                        <template slot-scope="scope">
                            <el-tag v-if="scope.row.brilliantBaseFlag == 'Y'" type="success">
                                {{ $t('practiceManagement.yes') }}
                            </el-tag>
                            <el-tag v-if="scope.row.brilliantBaseFlag == 'N'" type="warning">
                                {{ $t('practiceManagement.no') }}
                            </el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column
                        :label="$t('courseSummary.aduitType')"
                        show-overflow-tooltip
                        align="center"
                        fixed="right"
                        min-width="80"
                    >
                        <template slot-scope="scope">
                            <el-tag v-if="scope.row.status == 'DRAFT'">
                                {{ $t('practiceManagement.status.draft') }}
                            </el-tag>
                            <el-tag v-if="scope.row.status == 'INPROCESS'">
                                {{ $t('practiceManagement.status.inProcess') }}
                            </el-tag>
                            <el-tag v-if="scope.row.status == 'APPROVED'" type="success">
                                {{ $t('practiceManagement.status.approved') }}
                            </el-tag>
                            <el-tag v-if="scope.row.status == 'REJECTED'" type="warning">
                                {{ $t('practiceManagement.status.rejected') }}
                            </el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column :label="$t('message.operating')" fixed="right" width="140">
                        <template slot-scope="scope">
                            <el-button
                                type="text"
                                v-if="menuAuths.auditBut && scope.row.status === 'INPROCESS'"
                                @click="editor(scope.row)"
                                size="mini"
                            >
                                {{ $t('message.check') }}
                            </el-button>
                            <el-button
                                type="text"
                                v-if="scope.row.status === 'DRAFT'"
                                @click="edit(scope.row)"
                                size="mini"
                            >
                                {{ $t('message.edit') }}
                            </el-button>
                            <el-button type="text" @click="del(scope.row.id)" size="mini">
                                {{ $t('message.delete') }}
                            </el-button>
                            <el-button type="text" @click="details(scope.row)" size="mini">
                                {{ $t('message.detail') }}
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>

                <div class="edu-pagination">
                    <div class="float-right">
                        <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="page.pageNum_"
                            :page-sizes="[20, 50, 100, 500, 1000]"
                            :page-size="page.pageSize_"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="page.total_"
                            style="float:right;margin-top:10px"
                        ></el-pagination>
                    </div>
                </div>
            </el-card>

            <!-- 新增 -->
            <el-dialog
                :title="title"
                :width="$store.state.common.dialogWidth1200"
                :visible.sync="showDialog"
                :close-on-click-modal="false"
            >
                <div class="dialog-box">
                    <edu-form :model="addForm" ref="addForm" label-width="175px" :rules="rules">
                        <el-row>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.baseName')"
                                    prop="baseName"
                                >
                                    <el-input v-model="addForm.baseName" :placeholder="$t('fundingManagement.tips.plzInput')" maxlength="50"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.practiceArea')"
                                    prop="practiceArea"
                                >
                                    <el-select
                                        v-model="addForm.practiceArea"
                                        :clearable="false"
                                        required
                                        :placeholder="$t('message.plzSelect')"
                                        class="inputclass"
                                        :disabled="disabled"
                                    >
                                        <el-option
                                            v-for="item in practiceArr"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value"
                                        ></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.address')"
                                    prop="address"
                                >
                                    <el-input v-model="addForm.address" :placeholder="$t('fundingManagement.tips.plzInput')" maxlength="50"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.maxNum')"
                                    prop="acceptNum"
                                >
                                    <el-input v-model="addForm.acceptNum" :placeholder="$t('fundingManagement.tips.plzInput')" maxlength="6"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.baseContactUser')"
                                    prop="baseContactUser"
                                >
                                    <el-input
                                        v-model="addForm.baseContactUser"
                                        :placeholder="$t('fundingManagement.tips.plzInput')"
                                        maxlength="15"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.baseContactPhone')"
                                    prop="baseContactPhone"
                                >
                                    <el-input
                                        v-model="addForm.baseContactPhone"
                                        :placeholder="$t('fundingManagement.tips.plzInput')"
                                        maxlength="11"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.baseContactEmail')"
                                    prop="baseContactEmail"
                                >
                                    <el-input
                                        v-model="addForm.baseContactEmail"
                                        :placeholder="$t('fundingManagement.tips.plzInput')"
                                        maxlength="25"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.baseContactDepName')"
                                >
                                    <el-input
                                        v-model="addForm.baseContactDepName"
                                        :placeholder="$t('fundingManagement.tips.plzInput')"
                                        maxlength="30"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.validDateStart')"
                                    prop="validDateStart"
                                >
                                    <el-date-picker
                                        v-model="addForm.validDateStart"
                                        type="date"
                                        clearable
                                        value-format="yyyy-MM-dd"
                                        :placeholder="$t('practiceManagement.tips.selectStartTime')"
                                        style="width: 180px"
                                        :picker-options="pickerOptions3"
                                    >
                                        >
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.validDateEnd')"
                                    prop="validDateEnd"
                                >
                                    <el-date-picker
                                        v-model="addForm.validDateEnd"
                                        type="date"
                                        clearable
                                        value-format="yyyy-MM-dd"
                                        :placeholder="$t('practiceManagement.tips.selectEndTime')"
                                        style="width: 180px"
                                        :picker-options="pickerOptions4"
                                    >
                                        >
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.brilliantBaseFlag')"
                                    label-width="170px"
                                    prop="brilliantBaseFlag"
                                >
                                    <el-select
                                        v-model="addForm.brilliantBaseFlag"
                                        :placeholder="$t('message.plzSelect')"
                                        size="small"
                                    >
                                        <el-option
                                            :label="$t('practiceManagement.yes')"
                                            value="Y"
                                        ></el-option>
                                        <el-option
                                            :label="$t('practiceManagement.no')"
                                            value="N"
                                        ></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.toSign')"
                                    prop="signConFlag"
                                >
                                    <el-select
                                        v-model="addForm.signConFlag"
                                        :placeholder="$t('message.plzSelect')"
                                        size="small"
                                    >
                                        <el-option
                                            :label="$t('practiceManagement.yes')"
                                            value="Y"
                                        ></el-option>
                                        <el-option
                                            :label="$t('practiceManagement.no')"
                                            value="N"
                                        ></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8" v-if="signConFlags">
                                <el-form-item
                                    :label="$t('practiceManagement.label.signConDate')"
                                    prop="signConDate"
                                >
                                    <el-date-picker
                                        v-model="addForm.signConDate"
                                        type="date"
                                        clearable
                                        value-format="yyyy-MM-dd"
                                        format="yyyy-MM-dd"
                                        :placeholder="$t('practiceManagement.tips.selectStartTime')"
                                        style="width: 180px"
                                    ></el-date-picker>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <el-row v-if="signConFlags">
                            <el-col>
                                <el-form-item
                                    :label="$t('practiceManagement.label.udgPtAttachTList')"
                                    prop="udgPtAttachTList"
                                    class="upload-box"
                                >
                                    <el-upload
                                        v-model="addForm.udgPtAttachTList"
                                        :headers="{ 'X-Token': $store.state.session.sessionid }"
                                        :data="{ bucketname: 'face', folderpath: 'file' }"
                                        :on-remove="handleFileRemove"
                                        :on-success="handleUploadSuccess"
                                        :on-change="handleChangePic"
                                        :file-list="infoFileList"
                                        class="upload-demo"
                                        :before-upload="beforeAvatarUpload"
                                        action="/api/commonservice/obsfile/uploadfile"
                                        accept=" .jpg,.png,.docx,.JPG,.BMP,.PDF,.rar,.zip,.doc"
                                    >
                                        <div class="upload">
                                            <el-button size="small" type="primary">
                                                {{ $t('practiceManagement.label.uploadFile') }}
                                            </el-button>
                                            <div class="upload_div">
                                                {{ $t('practiceManagement.tips.uploadTips') }}
                                            </div>
                                        </div>
                                    </el-upload>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.academyName')"
                                    prop="academyName"
                                >
                                    <!--                                  <el-input v-model="addForm.academyName" disabled></el-input>-->
                                    <el-select
                                        v-model="addForm.academyId"
                                        @change="onChangeAcademy"
                                        :placeholder="$t('message.plzSelect')"
                                    >
                                        <el-option
                                            v-for="item in aimSelectDepartmentArr"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value"
                                        ></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.academyContactUser')"
                                    prop="academyContactUser"
                                >
                                    <el-select
                                        v-model="addForm.academyContactUser"
                                        clearable
                                        remote
                                        filterable
                                        :placeholder="$t('message.plzSelect')"
                                        :remote-method="queryteacher"
                                        @change="changeTeacher($event)"
                                    >
                                        <el-option
                                            v-for="item in teacherList"
                                            :key="item"
                                            :label="item.label"
                                            :value="item.label"
                                        ></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.academyContactPhone')"
                                    prop="academyContactPhone"
                                >
                                    <el-input
                                        v-model="addForm.academyContactPhone"
                                        :placeholder="$t('fundingManagement.tips.plzInput')"
                                        maxlength="11"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item
                                    :label="$t('practiceManagement.label.academyEmail')"
                                    prop="academyEmail"
                                >
                                    <el-input
                                        v-model="addForm.academyEmail"
                                        :placeholder="$t('fundingManagement.tips.plzInput')"
                                        maxlength="25"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-form-item :label="$t('message.remark')">
                                <el-input
                                    type="textarea"
                                    v-model="addForm.remark"
                                    maxlength="150"
                                    :rows="5"
                                    :placeholder="$t('fundingManagement.tips.plzInput')"
                                    resize="none"
                                ></el-input>
                            </el-form-item>
                        </el-row>
                    </edu-form>
                </div>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="cancelDialog">{{ $t('message.cancel') }}</el-button>
                    <el-button type="primary" @click="submitaddForm('0')">
                        {{ $t('message.save') }}
                    </el-button>
                    <el-button type="primary" @click="submitaddForm('1')">
                        {{ $t('message.submit') }}
                    </el-button>
                </div>
            </el-dialog>
        </div>

        <div v-if="indexKey === '1' || indexKey === '2'">
            <el-card>
                <div class="edu-page-title title-text">
                    {{ $t('practiceManagement.title.baseDetailTitle') }}
                </div>

                <table width="100%" border="1">
                    <tr>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.baseName') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.baseName }}</td>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.practiceArea') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.practiceAreas }}</td>
                    </tr>
                    <tr>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.address') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.address }}</td>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.maxNum') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.acceptNum }}</td>
                    </tr>
                    <tr>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.baseContactUser') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.baseContactUser }}</td>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.baseContactPhone') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.baseContactPhone }}</td>
                    </tr>
                    <tr>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.baseContactEmail') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.baseContactEmail }}</td>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.baseContactDepName') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.baseContactDepName }}</td>
                    </tr>
                    <tr>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.validDateStart') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.validDateStart }}</td>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.validDateEnd') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.validDateEnd }}</td>
                    </tr>
                    <tr>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.brilliantBaseFlag') }}
                        </td>
                        <td width="30%" class="title-text">
                            <span v-if="detailsForm.brilliantBaseFlag == 'Y'" type="success">
                                {{ $t('practiceManagement.yes') }}
                            </span>
                            <span v-if="detailsForm.brilliantBaseFlag == 'N'" type="warning">
                                {{ $t('practiceManagement.no') }}
                            </span>
                        </td>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.toSign') }}
                        </td>
                        <td width="30%" class="title-text">
                            <span v-if="detailsForm.signConFlag == 'Y'" type="success">
                                {{ $t('practiceManagement.yes') }}
                            </span>
                            <span v-if="detailsForm.signConFlag == 'N'" type="warning">
                                {{ $t('practiceManagement.no') }}
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.signConDate') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.signConDate }}</td>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.udgPtAttachTList') }}
                        </td>
                        <td width="30%" class="title-text">
                            <div v-for="item in detailsForm.udgPtAttachTList" :key="item">
                                <div @click="download(item.attachPath)">
                                    <a>{{ item.attachName }}</a>
                                </div>
                            </div>
                        </td>

                    </tr>
                    <tr>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.academyName') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.academyName }}</td>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.academyContactUser') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.academyContactUser }}</td>
                    </tr>
                    <tr>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.academyContactPhone') }}
                        </td>
                        <td width="30%" class="title-text">
                            {{ detailsForm.academyContactPhone }}
                        </td>
                        <td width="20%" class="title">
                            {{ $t('practiceManagement.label.academyEmail') }}
                        </td>
                        <td width="30%" class="title-text">{{ detailsForm.academyEmail }}</td>
                    </tr>
                    <tr>
                        <td width="20%" class="title">{{ $t('message.remark') }}</td>
                        <td width="30%" class="title-text" colspan="3">{{ detailsForm.remark }}</td>
                    </tr>
                </table>
            </el-card>
            <el-card>
                <div class="edu-page-title tip" v-if="!fromCheckDetail">{{ $t('message.check') }}</div>
                <el-form ref="form" :model="form" label-width="120px" v-if="!fromCheckDetail">
                    <el-form-item :label="$t('practiceManagement.opinion')">
                        <el-input
                            type="textarea"
                            rows="4"
                            v-model="form.auditRemark"
                            maxlength="200"
                            style="width:90%"
                            :disabled="state !== '0'"
                        ></el-input>
                    </el-form-item>
                </el-form>
                <div class="button-box">
                    <div class="float-right">
                        <el-button v-if="state === '0'" @click="back">
                            {{ $t('message.cancel') }}
                        </el-button>
                        <el-button v-if="state === '0'" :disabled="fromCheckDetail" type="danger" @click="ApplyReject('1')">
                            {{ $t('message.reject') }}
                        </el-button>
                        <el-button v-if="state === '0'" :disabled="fromCheckDetail" type="primary" @click="ApplyPass('1')">
                            {{ $t('message.pass') }}
                        </el-button>
                        <el-button v-else @click="back">{{ $t('message.return') }}</el-button>
                    </div>
                </div>
            </el-card>

            <!-- 审核进度部分 -->
            <el-card body-style="padding: 24px;" class="card-margin" v-if="state === '1'||this.dataInfo.wfType==133">
                <h1 class="condition-title">{{ $t('practiceManagement.reviewProgress') }}</h1>
                <el-table :data="auditList" stripe style="width: 100%">
                    <el-table-column type="index" :label="$t('message.order')" />
                    <el-table-column
                        prop="time"
                        :label="$t('paperBlindTrial.tiemName')"
                        align="center"
                        show-overflow-tooltip
                    >
                        <template slot-scope="scope">
                            {{ scope.row.time | formatDate }}
                        </template>
                    </el-table-column>
                    <el-table-column
                        prop="approvorName"
                        :label="$t('achievementApply.approvorName')"
                        align="center"
                    />
                    <el-table-column prop="role" :label="$t('academicApply.role')" align="center" />
                    <el-table-column
                        prop="content"
                        :label="$t('achievementApply.explanation')"
                        show-overflow-tooltip
                    />
                    <el-table-column prop="result" :label="$t('message.operating')" align="center">
                        <template slot-scope="scope">
                            <el-tag v-if="scope.row.result == 'COMMIT'" type="success">
                                {{ $t('message.submit') }}
                            </el-tag>
                            <el-tag v-if="scope.row.result == 'Process'" type="success">
                                {{ $t('message.pass') }}
                            </el-tag>
                            <el-tag v-if="scope.row.result == 'End'" type="info">
                                {{ $t('message.approvaled') }}
                            </el-tag>
                            <el-tag v-if="scope.row.result == 'Reject'" type="warning">
                                {{ $t('message.reject') }}
                            </el-tag>
                            <el-tag v-if="scope.row.result == 'Recall'" type="warning">
                                {{ $t('message.recall') }}
                            </el-tag>
                        </template>
                    </el-table-column>
                </el-table>
            </el-card>
        </div>
        <!-- 批量审核弹框 -->
        <el-dialog
            :title="$t('message.AllApproval')"
            :width="$store.state.common.dialogWidth600"
            :visible.sync="showDialog2"
            :close-on-click-modal="false"
        >
            <el-form ref="form" :model="form" label-width="80px">
                <el-form-item :label="$t('practiceManagement.opinion')" prop="auditRemark">
                    <el-input
                        type="textarea"
                        rows="4"
                        v-model.trim="form.auditRemark"
                        maxlength="200"
                    ></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="cancelDialog2">{{ $t('message.cancel') }}</el-button>
                <el-button type="danger" @click="reject">{{ $t('message.reject') }}</el-button>
                <el-button type="primary" @click="through">{{ $t('message.pass') }}</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
import {
    udgPtBaseInfoList,
    addudgPtBaseInfo,
    deleteudgPtBaseInfo,
    submitReview,
    updateudgPtBaseInfo,
    exportBaseInfo
} from 'common/src/api/practiceManagement/internSetup'
import { findTeacherList } from 'common/src/api/resource/teachers'
import { queryDic } from 'common/src/api/dictionary'
import UTILS from 'common/src/utils/utils'
import { downloadfile } from 'common/src/api/upload'
import { approvalThrough, approvalReject } from 'common/src/api/approval'
import { selectApproFlow } from 'common/src/api/approval'
import filters from 'common/src/filters'
import { approvelDetail } from 'common/src/api/approval'
import { throughBatch, rejectBatch } from 'common/src/api/studentRegister'
import commonMixins from '../commonMixins'
import { findManageDepartment } from 'common/src/api/user'
import mixin from 'common/src/mixins/index';
export default {
    name: 'baseList',
    mixins: [commonMixins,mixin],
    filters: {
        formatDate(date) {
            return filters.formatDate(date, 'yyyy/MM/dd hh:mm:ss')
        }
    },
    props: {
      fromCheckDetail:{
        type: Boolean,
        required: false
      },
      dataInfo: {
        type: Object,
        default: {}
      },
    },
    data() {
        return {
            title: this.$t('practiceManagement.title.addTitle'),
            showDialog: false,
            showDialog2: false,
            disabled: false,
            signConFlags: false,
            state: '0',
            queryParams: {
                faculty: ''
            },
            addForm: {
                id: '',
                baseName: '',
                practiceArea: '',
                address: '',
                acceptNum: 1,
                baseContactUser: '',
                baseContactPhone: '',
                baseContactDepName: '',
                baseContactEmail: '',
                activeAuthId: '',
                validDateStart: null,
                validDateEnd: null,
                brilliantBaseFlag: '',
                signConFlag: '',
                signConDate: '',
                signConFileId: '',
                academyId: '',
                academyName: '',
                faculty: '',
                academyContactUser: '',
                academyContactPhone: '',
                academyEmail: '',
                remark: '',
                needSubmit: true,
                name: '',
                udgPtAttachTList: []
            },
            detailsForm: {
                id: '',
                baseName: '',
                practiceArea: '',
                address: '',
                acceptNum: 1,
                baseContactUser: '',
                baseContactPhone: '',
                baseContactDepName: '',
                baseContactEmail: '',
                baseContactDepName: '',
                activeAuthId: '',
                validDateStart: null,
                validDateEnd: null,
                brilliantBaseFlag: '',
                signConFlag: '',
                signConDate: '',
                signConFileId: '',
                academyId: 0,
                academyName: '',
                faculty: '',
                academyContactUser: '',
                academyContactPhone: '',
                academyEmail: '',
                remark: '',
                workFlowId: '',
                needSubmit: true,
                udgPtAttachTList: [
                    {
                        attachName: '',
                        attachSize: '',
                        attachPath: ''
                    }
                ]
            },
            informationCheckForm: {
                type: 20,
                informationFileList: []
            },
            name: {},
            form: {
                auditRemark: ''
            },
            indexKey: this.$route.query.indexKey?this.$route.query.indexKey:'0',
            page: {
                pageNum_: 1,
                pageSize_: 20,
                total_: 0
            },
            condition: {
                baseName: '',
                signConFlag: '',
                status: '',
                effectStatus: '',
                academyId: '',
                brilliantBaseFlag: '',
                validDateStart: '',
                validDateEnd: ''
            },
            teacherList: [],
            infoFileList: [],
            breadPath: {
                label: this.$t('practiceManagement.title.baseTitle'),
                key: '0',
                children: [
                    {
                        key: '1',
                        label: this.$t('message.check')
                    },
                    {
                        key: '2',
                        label: this.$t('message.detail')
                    }
                ]
            },
            tableData: [],

            rollInfo: [],
            auditList: [],
            options: {
                faculty: []
            },
            queryteacherData: {
                faculty: null,
                teachQual: '1',
                pageSize_: 50,
                pageNum_: 1
            },
            rules: {
                baseName: [
                    { required: true, message: this.$t('inputPlaceholder'), trigger: 'blur' }
                ],
                practiceArea: [
                    {
                        required: true,
                        message: this.$t('message.plzSelect'),
                        trigger: ['blur', 'change']
                    }
                ],
                address: [
                    { required: true, message: this.$t('inputPlaceholder'), trigger: 'blur' }
                ],
                acceptNum: [
                    { required: true, message: this.$t('inputPlaceholder'), trigger: 'blur' },
                    {
                        pattern: /^[1-9]\d*$/,
                        message: this.$t('practiceManagement.tips.nonZone'),
                        trigger: 'blur'
                    }
                ],
                baseContactUser: [
                    { required: true, message: this.$t('inputPlaceholder'), trigger: 'blur' }
                ],
                baseContactPhone: [
                    { required: true, message: this.$t('inputPlaceholder'), trigger: ['blur'] },
                    {
                        pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
                        message: this.$t('practiceManagement.tips.phone'),
                        trigger: ['blur']
                    }
                ],
                baseContactDepName: [
                    { required: true, message: this.$t('inputPlaceholder'), trigger: 'blur' }
                ],
                baseContactEmail: [
                    {
                        required: true,
                        message: this.$t('inputPlaceholder'),
                        trigger: ['blur', 'change']
                    },
                    { validator: this.isEmail, trigger: 'blur' }
                ],
                signConDate: [
                    { required: true, message: this.$t('message.plzSelect'), trigger: ['change'] }
                ],
                signConFlag: [
                    { required: true, message: this.$t('message.plzSelect'), trigger: ['change'] }
                ],
                validDateStart: [
                    {
                        required: true,
                        message: this.$t('message.plzSelect'),
                        trigger: ['blur', 'change']
                    }
                ],
                validDateEnd: [
                    {
                        required: true,
                        message: this.$t('message.plzSelect'),
                        trigger: ['blur', 'change']
                    }
                ],
                brilliantBaseFlag: [
                    {
                        required: true,
                        message: this.$t('message.plzSelect'),
                        trigger: ['blur', 'change']
                    }
                ],
                academyContactPhone: [
                    { required: true, message: this.$t('inputPlaceholder'), trigger: ['blur'] },
                    { validator: this.isContactNumber, trigger: 'blur' }
                ],
                udgPtAttachTList: [
                    {
                        required: true,
                        message: this.$t('practiceManagement.tips.plzUploadFile'),
                        trigger: 'change',
                        validator: this.isudgpt
                    }
                ],
                academyName: [
                  {
                    required: true,
                    message: this.$t('message.plzSelect'),
                    trigger: ['blur', 'change']
                  }
                ],
                academyContactUser: [
                    {
                        required: true,
                        message: this.$t('message.plzSelect'),
                        trigger: ['blur', 'change']
                    }
                ],
                academyEmail: [
                    { required: true, message: this.$t('inputPlaceholder'), trigger: 'blur' },
                    { validator: this.isEmail, trigger: 'blur' }
                ]
            },
            selection: [],
            practiceArr: [],
            practiceArrs: [],
            auths: [],
            menuAuths: {
                auditBut: false,
                aduitBatch: false
            },
            pickerOptions: {
                disabledDate: time => {
                    if (this.condition.validDateEnd) {
                        return time.getTime() > new Date(this.condition.validDateEnd).getTime()
                    }
                }
            },
            pickerOptions2: {
                disabledDate: time => {
                    if (this.condition.validDateStart) {
                        return (
                            time.getTime() <
                            new Date(this.condition.validDateStart).getTime() - 86400000
                        )
                    }
                }
            },
            pickerOptions3: {
                disabledDate: time => {
                    if (this.addForm.validDateEnd) {
                        return time.getTime() > new Date(this.addForm.validDateEnd).getTime()
                    }
                }
            },
            pickerOptions4: {
                disabledDate: time => {
                    if (this.addForm.validDateStart) {
                        return (
                            time.getTime() <
                            new Date(this.addForm.validDateStart).getTime() - 86400000
                        )
                    }
                }
            },
            //目标学院
            aimSelectDepartmentArr: [],
            //前端缓存中的用户信息
            localStorageUser: {}
        }
    },
    watch: {
        'addForm.signConFlag': function(newVal, oldVal) {
            if (newVal && newVal === 'Y') {
                this.signConFlags = true
            } else if (newVal && newVal === 'N') {
                this.signConFlags = false
                this.addForm.signConDate = null
                this.addForm.udgPtAttachTList = []
            }
        },
        auths: {
            handler(newVal) {
                if (newVal && Array.isArray(newVal) && newVal.length > 0) {
                    newVal.some(item => {
                        //存在拥有多个权限，不加break打断
                        switch (item.authCode) {
                            case 'baseList-auditBut':
                                this.menuAuths.auditBut = true
                            case 'baseList-aduitBatch':
                                this.menuAuths.aduitBatch = true
                            default:
                                break
                        }
                    })
                }
            }
        }
    },
    created() {

         if(this.dataInfo.no){
            this.detailsForm=this.dataInfo.content;
            this.detailsForm.workFlowId=this.dataInfo.no;
            if(this.dataInfo.auditRemark){
              this.form.auditRemark=this.dataInfo.auditRemark;
            }
            this.auditList=this.dataInfo.listApproveHistory;//审核进度
          }

        // 获取当前用户auths权限
        this.localStorageUser = this.global.currentUser
        this.auths = JSON.parse(localStorage.getItem('sessiondata')).auths

        this.searchList()
        this.getOptions()
        this.initOptions()
        this.getteacherList()
        this.getManageDepartment()

    },
    methods: {
        // 字典获取
        getOptions() {
            // 筛选条件字典查询
            let data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: ['UDG_TRAINNING_POSITION']
            }
            queryDic(data).then(res => {
                for (let key in res.data.UDG_TRAINNING_POSITION) {
                    if (parseInt(key) !== 410001) {
                        this.practiceArr.push({
                            label: res.data.UDG_TRAINNING_POSITION[key],
                            value: key.toString()
                        })
                    }
                    this.practiceArrs.push({
                        label: res.data.UDG_TRAINNING_POSITION[key],
                        value: key.toString()
                    })
                }
            })
            this.practiceArr = this.practiceArr.splice(0, 1)
        },
        initOptions() {
            const data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: ['X_PYCC', 'X_YX', 'X_PYLB']
            }
            queryDic(data).then(res => {
                if (res.code === 200) {
                    this.fillSelect(res.data)
                }
            })
        },
        fillSelect(data) {
            let { X_PYCC, X_YX, X_PYLB } = data
            this._fill('faculty', X_YX)
        },
        _fill(type, data) {
            for (const key in data) {
                this.options.faculty.push({
                    value: key,
                    label: data[key]
                })
            }
        },
        getteacherList() {
            if(this.queryteacherData.faculty){
                findTeacherList(this.queryteacherData).then(res => {
                    if (res.code == 200) {
                        this.teacherList = res.data.list.map(item => {
                            return {
                                // label: item.name + '(' + item.code + ')' + '-' + item.facultyI18n,
                                label: item.name + '(' + item.code + ')',
                                phone: item.phone,
                                email: item.email
                            }
                        })
                    }
                })
            }
        },
        onSubmit() {
            this.searchList(true)
        },
        searchList(refresh) {
            if (refresh) {
                this.page.pageNum_ = 1
            }
            udgPtBaseInfoList(this.page.pageNum_, this.page.pageSize_, this.condition).then(res => {
                if (res.code === 200) {
                    this.page.total_ = res.data.total
                    this.tableData = res.data.records
                }
            })
        },
        //搜索联系人
        queryteacher(query) {
            this.queryteacherData.condition = query
            this.getteacherList()
        },

        changeTeacher(e) {
            if (!e) {
                this.queryteacherData.condition = ''
                this.getteacherList()
            }
            this.teacherList.forEach(el => {
                if (el.label === e) {
                    // this.$set(this.addForm, 'academyContactPhone', el.phone);
                    // this.$set(this.addForm, 'academyEmail', el.email);
                    // this.$nextTick(() => {
                    //     this.$refs.addForm.validateField('academyContactPhone');
                    //     this.$refs.addForm.validateField('academyEmail');
                    // });
                    this.addForm.academyContactPhone = el.phone
                    this.addForm.academyEmail = el.email
                }
            })
        },
        selectionChange(selection) {
            this.selection = selection
        },
        selectAll(rows) {},
        //获取附件
        getAttachment(fileList) {
            if (fileList) {
                let attachList = []
                fileList.forEach(item => {
                    const attachObj = {}
                    attachObj.name = item.attachName
                    attachObj.url = item.attachPath
                    attachList.push(attachObj)
                })
                return attachList
            }
        },
        //下载
        download(key) {
            downloadfile(key)
        },
        //学院改变获取专业
        changeFaculty(val) {},
        // 导出
        exportRecord() {
            this.exportCondition = this.condition
            if (this.selection.length === 0) {
                this.exportData = {
                    exportType: 0,
                    exportCondition: this.exportCondition
                }
            } else {
                this.exportData = {
                    exportType: 1,
                    rows: this.selection,
                    exportCondition: this.exportCondition
                }
            }
            exportBaseInfo(this.exportData)
        },
        handleSizeChange(val) {
            this.page.pageSize_ = val
            this.searchList()
        },
        handleCurrentChange(val) {
            this.page.pageNum_ = val
            this.searchList()
        },
        reset() {
            for (const key in this.condition) {
                if (key != 'calendarId' && key != 'projectId') this.condition[key] = ''
            }
            this.condition.calendarId = this.currentTermCalendar
            this.searchList(true)
        },
        add() {
            this.showDialog = true
            this.$nextTick(() => {
                this.$refs['addForm'].clearValidate()
            })
            this.infoFileList = []
            this.type = '0'
            this.title = this.$t('practiceManagement.title.addTitle');
            this.clearAddForm()
            // this.addForm.academyId = this.localStorageUser.faculty
            // this.addForm.academyName = this.localStorageUser.facultyName
            this.name = {}
        },
        edit(row) {
            this.showDialog = true
            this.type = '0'
            this.title = this.$t('practiceManagement.title.editTitle');
            this.addForm = { ...row }
            this.infoFileList = this.getAttachment(this.addForm.udgPtAttachTList)
            this.name = row.academyContactUser
            this.$nextTick(() => {
                this.$refs['addForm'].clearValidate()
            })
        },
        approval() {
            let flag = false
            if (this.selection.length > 0) {
                this.selection.map(item => {
                    if (item.status !== 'INPROCESS') {
                        flag = true
                        return
                    }
                })
                if (flag) {
                    this.$message({
                        type: 'warning',
                        message: this.$t('practiceManagement.tips.plzCheck')
                    })
                    return
                } else {
                    this.showDialog2 = true
                    this.form.auditRemark = ''
                }
            } else {
                this.$message({
                    type: 'warning',
                    message: this.$t('practiceManagement.tips.plzData')
                })
            }
        },
        //取消批量审核对话框
        cancelDialog2() {
            this.showDialog2 = false
        },
        //审核
        editor(row) {
            this.indexKey = '1'
            this.state = '0'
            this.detailsForm = { ...row }
            this.$set(
                this.detailsForm,
                'practiceAreas',
                this.fieldChange(this.practiceArrs, this.detailsForm.practiceArea)
            )
            this.form.auditRemark = ''
        },
        details(row) {
            this.indexKey = '2'
            this.state = '1'
            this.detailsForm = { ...row }
            this.$set(
                this.detailsForm,
                'practiceAreas',
                this.fieldChange(this.practiceArrs, this.detailsForm.practiceArea)
            )
            this.auditList = []
            if (row.workFlowId) {
                var param = {
                    no: row.workFlowId
                }
                approvelDetail(param).then(res => {
                    if (res && res.data) {
                        this.auditList = res.data.listApproveHistory
                        this.form.auditRemark =
                            res.data.listApproveHistory[
                                res.data.listApproveHistory.length - 1
                            ].content
                    }
                })
            }
        },
        back() {
          if(this.dataInfo.wfType==133){
            this.$router.go(-1);
          }else{
            this.$router.push('/baseList')
            this.indexKey = '0'
          }

        },
        //取消对话框
        cancelDialog() {
            this.showDialog = false
            this.$nextTick(() => {
                this.$refs['addForm'].clearValidate()
            })
        },

        submitaddForm(type) {
            // 判断保存还是提交
            if (type === '0') {
                this.addForm.needSubmit = false
            } else {
                this.addForm.needSubmit = true
            }
            this.$refs.addForm.validate(valid => {
                if (valid) {
                    if (this.title === this.$t('practiceManagement.title.addTitle')) {
                        addudgPtBaseInfo(this.addForm).then(res => {
                            if (res.code === 200) {
                                this.$message({
                                    type: 'success',
                                    message: this.$t('message.submitSuccess')
                                })
                                this.showDialog = false
                                this.reset()
                            }
                        })
                    } else {
                        updateudgPtBaseInfo(this.addForm).then(res => {
                            if (res.code === 200) {
                                this.$message({
                                    type: 'success',
                                    message: this.$t('message.saveSuccess')
                                })
                                this.showDialog = false
                                this.searchList(true)
                            }
                        })
                    }
                }
            })
        },

        // 删除
        del(id) {
            this.$confirm(this.$t('message.areYouSureDelete'), this.$t('message.prompt'), {
                confirmButtonText: this.$t('message.confirm'),
                cancelButtonText: this.$t('message.cancel'),
                type: 'warning'
            }).then(() => {
                deleteudgPtBaseInfo(id).then(res => {
                    if (res.code === 200) {
                        this.$message({
                            type: 'success',
                            message: this.$t('message.deleteSuccess')
                        })
                        this.searchList(true)
                    }
                })
            })
        },
        submitForm() {
            this.$refs.queryParams.validate(valid => {
                if (valid) {
                }
            })
        },

        // 上传
        handleFileRemove(file, fileList) {
            this.addForm.udgPtAttachTList = []
            this.infoFileList = []
        },
        handleUploadSuccess(res, file, fileList) {
            this.addForm.udgPtAttachTList = []
            let obj = {}
            for (let key in res.data) {
                obj.attachPath = res.data[key].objectkey
            }
            obj.attachName = file.name
            obj.attachSize = file.size
            this.addForm.udgPtAttachTList.push(obj)
            this.$nextTick(() => {
                this.$refs['addForm'].validateField('udgPtAttachTList')
            })
        },
        handleChangePic(file, fileList) {
            if (fileList.length > 1) {
                fileList.splice(0, 1)
            }
        },
        beforeAvatarUpload(file) {
            const isLt2M = file.size / 1024 / 1024 < 10
            if (!isLt2M) {
                this.$message({
                    message: this.$t('practiceManagement.tips.sizeLimit'),
                    type: 'warning'
                })
            }
            return isLt2M
        },
        // 审批通过
        ApplyPass(t) {
            let param = {
                no: this.detailsForm.workFlowId,
                content: this.form.auditRemark,
                approveAttachment: [],
                oaNo: '',
                // remark: null,
                callbackEachTime: true
            }
            approvalThrough(param).then(res => {
                if (res.code == 200) {
                    this.$message({
                        type: 'success',
                        message: this.$t('practiceManagement.tips.checkSuc')
                    })
                    if(this.dataInfo.wfType==133){
                      this.fromCheckDetail=true
                      this.$router.go(-1);
                    }else{
                      this.indexKey = '0'
                    }

                    this.searchList(true)
                }
            })
        },
        // 审批驳回
        ApplyReject(t) {
            let param = {
                content: this.form.auditRemark,
                no: this.detailsForm.workFlowId,
                approveAttachment: [],
                oaNo: ''
                // remark: null
            }
            approvalReject(param).then(res => {
                if (res.code == 200) {
                    this.$message({
                        type: 'success',
                        message: this.$t('practiceManagement.tips.checkSuc')
                    })
                    if(dataInfo.wfType=133){
                      this.$router.go(-1);
                    }else{
                      this.indexKey = '0'
                    }
                    this.searchList(true)
                }
            })
        },

        //批量审批通过
        through() {
            let data = this.selection.map(r => {
                return {
                    no: r.workFlowId,
                    content: this.form.auditRemark
                }
            })
            throughBatch(data).then(res => {
                if (res.code == 200) {
                    this.$message({
                        type: 'success',
                        message: this.$t('practiceManagement.tips.batchCheck')
                    })
                    this.showDialog2 = false
                    this.searchList(true)
                }
            })
        },
        //批量审批拒绝
        reject() {
            if (this.form.auditRemark == '' || this.form.auditRemark == null) {
                this.$message({
                    type: 'warning',
                    message: this.$t('practiceManagement.tips.plzInputOpinion')
                })
                return
            }
            let data = this.selection.map(r => {
                return {
                    no: r.workFlowId,
                    content: this.form.auditRemark
                }
            })
            rejectBatch(data).then(res => {
                if (res.code == 200) {
                    this.$message({
                        type: 'success',
                        message: this.$t('practiceManagement.tips.batchCheckReject')
                    })
                    this.showDialog2 = false
                    this.searchList(true)
                }
            })
        },

        isEmail(rule, value, callback) {
            let reg = new RegExp(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/)
            if (value && !reg.test(value)) {
                return callback(new Error(this.$t('practiceManagement.tips.emailCheck')))
            } else {
                callback()
            }
        },
        // 校验联系人电话
        isContactNumber(rule, value, callback) {
            let reg1 = new RegExp(/^1(3|4|5|6|7|8|9)\d{9}$/)
            if (value && !reg1.test(value)) {
                return callback(new Error(this.$t('practiceManagement.tips.phone')))
            } else {
                callback()
            }
        },
        // 校验是否上传文件
        isudgpt(rule, value, callback) {
            if (!this.addForm.udgPtAttachTList || this.addForm.udgPtAttachTList.length === 0) {
                return callback(new Error(this.$t('practiceManagement.tips.plzUploadFile')))
            } else {
                callback()
            }
        },
        //获取管理学院部门
        getManageDepartment() {
            //先把所属学院放入
            this.aimSelectDepartmentArr = this.options.faculty
            // this.aimSelectDepartmentArr.push({
            //     item: this.localStorageUser.faculty,
            //     value: this.localStorageUser.facultyName
            // });
            // let data = {
            //     userType: 3,
            //     userId: this.localStorageUser.faculty
            // };
            // findManageDepartment(data).then(res => {

            //     if (res.data.manageFacultyList) {
            //         for (let item in res.data.manageFacultyList) {
            //             this.aimSelectDepartmentArr.push({
            //                 item: item,
            //                 value: res.data.manageFacultyList[item]
            //             })
            //         }
            //     }
            // })
        },
        //改变目标所属学院
        onChangeAcademy() {
            console.log("onChangeAcademy")
            for (let item in this.aimSelectDepartmentArr) {
                if (this.aimSelectDepartmentArr[item].value === this.addForm.academyId) {
                    this.addForm.academyName = this.aimSelectDepartmentArr[item].label
                }
            }
            //清空学院联系人
            this.addForm.academyContactUser = ''
            this.addForm.academyContactPhone = ''
            this.addForm.academyEmail = ''
            this.queryteacherData.faculty = this.addForm.academyId
            this.getteacherList()
        },
        //清空addform
        clearAddForm() {
            this.teacherList = ''
            this.addForm.id = ''
            this.addForm.baseName = ''
            this.addForm.practiceArea = ''
            this.addForm.address = ''
            this.addForm.acceptNum = 1
            this.addForm.baseContactUser = ''
            this.addForm.baseContactPhone = ''
            this.addForm.baseContactDepName = ''
            this.addForm.baseContactEmail = ''
            this.addForm.activeAuthId = ''
            this.addForm.validDateStart = null
            this.addForm.validDateEnd = null
            this.addForm.brilliantBaseFlag = ''
            this.addForm.signConFlag = ''
            this.addForm.signConDate = ''
            this.addForm.signConFileId = ''
            this.addForm.academyId = ''
            this.addForm.academyName = ''
            this.addForm.faculty = ''
            this.addForm.academyContactUser = ''
            this.addForm.academyContactPhone = ''
            this.addForm.academyEmail = ''
            this.addForm.remark = ''
            this.addForm.needSubmit = true
            this.addForm.name = ''
            this.addForm.udgPtAttachTList = [];
            this.signConFlags = false;
        },
        indexMethod(index) {
          return (this.page.pageNum_ - 1) * this.page.pageSize_ + index + 1;
        }
    }
}
</script>
<style lang="scss" scoped>
.details-table {
    border: 2px solid #e5e9f2;
}
.row-height {
    height: 50px;
    text-align: center;
    border-bottom: 1px solid #e5e9f2;
    .div-flex {
        display: flex;
        height: 100%;
        &.div-left {
            justify-content: flex-start;
        }
        .div-flex-left {
            flex: 1;
            text-align: right;
            height: 100%;
            border-right: 1px solid #e5e9f2;
            background-color: rgba(245, 247, 249, 1);
            line-height: 50px;
        }
        .div-flex-last-right {
            flex: 2;

            text-align: center;
            line-height: 50px;
        }
    }
}
.dialog-box {
    margin-right: 15px;
}
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
    width: 100%;
}
.el-select {
    width: 100%;
}
.el-date-editor.el-input {
    width: 100% !important;
}
.upload-box {
    position: relative;
}
.upload-button {
    position: absolute;
    top: 0;
    right: 1px;
}
table {
    border: 1px solid #d2d4d6;
    border-collapse: collapse;
}
.title {
    background: #f5f7f9;
    text-align: right;
    color: #8896a7;
    height: 30px;
}
.title-text {
    padding-left: 5px;
}
.tip {
    margin-bottom: 20px;
}
.button-box {
    border-top: 1px solid #d2d4d6;
    padding: 20px 0;
    margin-top: 10px;
}
.title-text {
    margin-bottom: 14px;
}
.upload {
    display: flex;
    align-items: center;
    &_div {
        margin-left: 10px;
    }
}
::v-deep .el-upload-list__item {
    width: 220px;
}
</style>
